<!-- 继承模板 -->
@extends('Admin/Layout/base')

<!-- 标题设置 -->
@section('title', '新增分类')

@section('style')
    <!-- 加载ueditor -->
    @include('vendor.ueditor.assets')
@endsection

@section('content')



<div class="row-content am-cf">

    <div class="row">

        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">新增分类</div>
                    <div class="widget-function am-fr">
                        {{-- <a href="javascript:;" class="am-icon-cog"></a> --}}
                    </div>
                </div>
                


                <div class="widget-body am-fr">
                       
                    <form class="am-form tpl-form-line-form" action="{{url('admin/category-store')}}" method="post" enctype="multipart/form-data">
                        
                        {{ csrf_field() }}

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">分类名 <span class="tpl-form-line-small-title">Category</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" class="tpl-form-input" id="user-name" name="name" placeholder="请输入分类名">
                                
                                @if ($errors->has('name'))
                                    <small style="color: red">{{ $errors->first('name') }}</small>
                                @else
                                    <small>分类名，限1-15个字符。</small>
                                @endif

                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">分类描述 <span class="tpl-form-line-small-title">Description</span></label>
                            <div class="am-u-sm-9">
                                <textarea class="" rows="7" name="description" id="user-intro" placeholder="请输入分类描述"></textarea>
                                
                                @if ($errors->has('description'))
                                    <small style="color: red">{{ $errors->first('description') }}</small>
                                @else
                                    <small>分类描述，限255个字符。</small>
                                @endif

                            </div>
                        </div>


                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">排序 <span class="tpl-form-line-small-title">Sort</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" name="sort" placeholder="请输入排序数字">

                                @if ($errors->has('sort'))
                                    <small style="color: red">{{ $errors->first('sort') }}</small>
                                @else
                                    <small>分类排序，在1-255之间，默认为1。数字越大，越靠前显示。</small>
                                @endif

                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-3 am-form-label">状态 <span class="tpl-form-line-small-title">Status</span></label>
                            <div class="am-u-sm-9">

                                <label class="am-radio-inline">
                                  <input type="radio" name="status" value="1" data-am-ucheck checked="true">
                                  显示
                                </label>

                                <label class="am-radio-inline">
                                  <input type="radio" name="status" value="0" data-am-ucheck>
                                  不显示
                                </label>

                            </div>
                        </div>

                        {{-- 按钮 --}}
                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success " onclick="history.back()">返回</button>
                            </div>
                        </div>
                        
                    </form>

                </div>
            </div>
        </div>
    </div>

</div>

<!-- 上传图片的form -->
{{-- <form name="uploadimg" id="uploadimg" action="{{url('/uploadpic')}}" enctype="multipart/form-data" method="post">
    {{ csrf_field() }}
</form> --}}

{{-- <form name="uploadimg" id="uploadimg" action="{{url('/uploadpic')}}" enctype="multipart/form-data" method="post">
    {{ csrf_field() }}
</form> --}}

@endsection


@section('footer-js')
   
<script type="text/javascript">

    function c () {
        var r= new FileReader();

        f=document.getElementById('doc-form-file').files[0];

        r.readAsDataURL(f);

        r.onload=function  (e) {
            document.getElementById('show').src=this.result;
        };
    }

</script>

@endsection